<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登陆</title>
    <link rel="stylesheet" href="{$_G['URL']['YX2020_CSS']}css/jumppage.css">
    <script src='https://res.wx.qq.com/open/js/jweixin-1.3.2.js'></script>
    <script src="{$_G['URL']['YX2020_CSS']}js/jquery.js?v=2"></script>
</head>
<body style="position:relative; width:100%; height:100%;">
    {if $fans['nickname'] =='微信用户'}
    <div class="loginBg">
        <div class="logoImg">
            {if !empty($_P['logp'])}
            <img src="{$_P['logp']}">
            {/if}
        </div>
        <div class="box2">
            <div class="item on1">可体验更多小程序功能</div>
            <div class="item on2">便携查看订单信息</div>
            <div class="item on3">与客服随时沟通</div>
        </div>
        <div class="loginButton">
            <div class="loginBtn">立即登录</div>
            <div class="subNoText">暂不登录</div>
        </div>
<!--        <div class="loginXieyi">-->
<!--            登录即表明您同意我们的 <span>《易宣软件用户协议》</span>-->
<!--        </div>-->
    </div>
    <script>
        $('.loginBtn').click(function () {
            var forward = '{php echo $fans['nickname']=='微信用户'?'/'.createMobileUrl("NewLoginUser",array("themeid"=>$themeid)):'';}';
            // var forward = '{$forward}';
            if (forward){
                window.location.href=forward;
                return ;
            }
        })
    </script>
    {else}
    <div class="loginButton">
        <div class="loginBtn">登录中</div>
    </div>
        {php $url =  'nickname=' . urlencode($fans['nickname']) .'&avatar='.urlencode($fans['avatar']);}
        <script>
            const data = {
                nickname: "{php echo urlencode($fans['nickname']);}",
                avatar: "{php echo urlencode($fans['avatar']);}"
            }
            wx.miniProgram.postMessage({data});
            setTimeout(() => {
                wx.miniProgram.navigateBack()
            })

            // wx.miniProgram.redirectTo({
            //     url: `/pages/index/index?{$url}&type={$_P['type']}&cb={$_P['cb']}`
            // });
        </script>
    {/if}
    {php echo $_P['type'];}
    <script>
        // JavaScript Document
        new function (){
            var _self = this;
            _self.width = 750;//设置默认最大宽度
            _self.fontSize = 100;//默认字体大小
            _self.widthProportion = function(){var p = (document.body&&document.body.clientWidth||document.getElementsByTagName("html")[0].offsetWidth)/_self.width;return p>1?1:p<0.32?0.32:p;};
            _self.changePage = function(){
                document.getElementsByTagName("html")[0].setAttribute("style","font-size:"+_self.widthProportion()*_self.fontSize+"px !important");
            }
            _self.changePage();
            window.addEventListener('resize',function(){_self.changePage();},false);
        };
    </script>
</body>
</html>